summaryrefslogtreecommitdiff
path: root/libavcodec/dca.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-10-27 11:42:23 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2011-10-29 16:04:07 -0400
commitaae6eead6a6e9bbab1c808d7552da5631ac78576 (patch)
tree7c5617f2c791f29efff1bb4154a1a9daa6a4fb81 /libavcodec/dca.c
parentf44059d26094c20277a6ec9f966c3bd453b6b9cf (diff)
downloadffmpeg-aae6eead6a6e9bbab1c808d7552da5631ac78576.tar.gz
dca: return error if the frame header is invalid
Diffstat (limited to 'libavcodec/dca.c')
-rw-r--r--libavcodec/dca.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libavcodec/dca.c b/libavcodec/dca.c
index 518fd30dbc..deb7245256 100644
--- a/libavcodec/dca.c
+++ b/libavcodec/dca.c
@@ -1637,7 +1637,7 @@ static int dca_decode_frame(AVCodecContext * avctx,
int lfe_samples;
int num_core_channels = 0;
- int i;
+ int i, ret;
float *samples_flt = data;
int16_t *samples_s16 = data;
int out_size;
@@ -1656,10 +1656,9 @@ static int dca_decode_frame(AVCodecContext * avctx,
}
init_get_bits(&s->gb, s->dca_buffer, s->dca_buffer_size * 8);
- if (dca_parse_frame_header(s) < 0) {
+ if ((ret = dca_parse_frame_header(s)) < 0) {
//seems like the frame is corrupt, try with the next one
- *data_size=0;
- return buf_size;
+ return ret;
}
//set AVCodec values with parsed data
avctx->sample_rate = s->sample_rate;