aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2013-07-15 11:28:46 +0300
committerSean McGovern <gseanmcg@gmail.com>2013-09-23 19:14:14 -0400
commit729143e2d27d5f06e6c4b959f4808a8a5fa7ca25 (patch)
tree99f0c2686be38622e47e3a18152fc81e45d8742b
parent36921fcdd3613dedd4046b59e3f43024fbfbbe17 (diff)
downloadffmpeg-729143e2d27d5f06e6c4b959f4808a8a5fa7ca25.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> (cherry picked from commit 8f24c12be7a3b3ea105e67bba9a867fe210a2333) Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
-rw-r--r--libavcodec/ac3dec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index 61097e99d9..2eac0ed12a 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -1345,7 +1345,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");
}