From 9340c97515130a9fb3460495b285458776c02996 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 28 Apr 2005 14:51:25 +0000 Subject: [PATCH] Actually check the output of parse_aac_data so that invalid codec data will not go unpunished. --- src/input/r_qtmp4.cpp | 9 ++++++--- src/input/r_real.cpp | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/input/r_qtmp4.cpp b/src/input/r_qtmp4.cpp index d088719f6..32d5eeb79 100644 --- a/src/input/r_qtmp4.cpp +++ b/src/input/r_qtmp4.cpp @@ -1475,9 +1475,12 @@ qtmp4_reader_c::create_packetizer(int64_t tid) { bool sbraac; if (dmx->esds.decoder_config_len >= 2) { - parse_aac_data(dmx->esds.decoder_config, - dmx->esds.decoder_config_len, profile, channels, - sample_rate, output_sample_rate, sbraac); + if (!parse_aac_data(dmx->esds.decoder_config, + dmx->esds.decoder_config_len, profile, channels, + sample_rate, output_sample_rate, sbraac)) + mxerror(FMT_TID "This AAC track does not contain valid headers. " + "Could not parse the AAC information.\n", ti.fname.c_str(), + (int64_t)dmx->id); mxverb(2, PFX "AAC: profile: %d, sample_rate: %d, channels: " "%d, output_sample_rate: %d, sbr: %d\n", profile, sample_rate, channels, output_sample_rate, (int)sbraac); diff --git a/src/input/r_real.cpp b/src/input/r_real.cpp index 8082f1f84..d02976888 100644 --- a/src/input/r_real.cpp +++ b/src/input/r_real.cpp @@ -361,9 +361,12 @@ real_reader_c::create_packetizer(int64_t tid) { mxverb(2, PFX "extra_len: %u\n", extra_len); if (dmx->extra_data_size >= (4 + extra_len)) { extra_data_parsed = true; - parse_aac_data(&dmx->extra_data[4 + 1], extra_len - 1, - profile, channels, sample_rate, output_sample_rate, - sbr); + if (!parse_aac_data(&dmx->extra_data[4 + 1], extra_len - 1, + profile, channels, sample_rate, + output_sample_rate, sbr)) + mxerror(FMT_TID "This AAC track does not contain valid headers. " + "Could not parse the AAC information.\n", + ti.fname.c_str(), (int64_t)track->id); mxverb(2, PFX "1. profile: %d, channels: %d, " "sample_rate: %d, output_sample_rate: %d, sbr: %d\n", profile, channels, sample_rate, output_sample_rate,