diff options
author | Martin Storsjö <martin@martin.st> | 2013-07-15 11:28:46 +0300 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2013-07-15 21:37:21 +0300 |
commit | 8f24c12be7a3b3ea105e67bba9a867fe210a2333 (patch) | |
tree | cb3235dd4a127bab19c83793cd1c1f2622dd56b4 | |
parent | 5b2a29552ca09edd4646b6aa1828b32912b7ab36 (diff) | |
download | ffmpeg-8f24c12be7a3b3ea105e67bba9a867fe210a2333.tar.gz |
ac3dec: Don't consume more data than the actual input packet size
This was handled properly in the normal return case at the end
of the function, but not in this special case.
Returning a value larger than the input packet size can cause
problems for certain library users.
Returning the actual input buffer size unconditionally, since
it is not guaranteed that frame_size is set to a sensible
value at this point.
Cc: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r-- | libavcodec/ac3dec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index 512d54b822..6a2792e24d 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -1308,7 +1308,7 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data, av_log(avctx, AV_LOG_ERROR, "unsupported frame type : " "skipping frame\n"); *got_frame_ptr = 0; - return s->frame_size; + return buf_size; } else { av_log(avctx, AV_LOG_ERROR, "invalid frame type\n"); } |