Module: libav Branch: release/0.8 Commit: 5773065a71055b5000717fab68e79647eea3dd6d
Author: Anton Khirnov <[email protected]> Committer: Sean McGovern <[email protected]> Date: Sat Aug 24 21:30:46 2013 +0200 pictordec: break out of both decoding loops when y drops below 0 Otherwise picmemset can get called with negative y, resulting in an invalid write. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: [email protected] (cherry picked from commit 5f7aecde02a95451e514c809f2794c1deba80695) Signed-off-by: Luca Barbato <[email protected]> --- libavcodec/pictordec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/pictordec.c b/libavcodec/pictordec.c index e0bc899..88add16 100644 --- a/libavcodec/pictordec.c +++ b/libavcodec/pictordec.c @@ -226,7 +226,7 @@ static int decode_frame(AVCodecContext *avctx, if (bits_per_plane == 8) { picmemset_8bpp(s, val, run, &x, &y); if (y < 0) - break; + goto finish; } else { picmemset(s, val, run, &x, &y, &plane, bits_per_plane); } @@ -236,6 +236,7 @@ static int decode_frame(AVCodecContext *avctx, av_log_ask_for_sample(s, "uncompressed image\n"); return avpkt->size; } +finish: *data_size = sizeof(AVFrame); *(AVFrame*)data = s->frame; _______________________________________________ libav-commits mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-commits
