Module: libav Branch: release/9 Commit: 612b28194b4c1fb55c8620a8cddf77ea6e81b9bf
Author: Anton Khirnov <[email protected]> Committer: Reinhard Tartler <[email protected]> Date: Thu Feb 14 12:40:36 2013 +0100 flicvideo: avoid an infinite loop in byte run compression When byte_run is 0, pixel_countdown is not touched and the loop will run forever. CC:[email protected] (cherry picked from commit ddfe1246d98f70cdce368a2176196ba26ed7bf2d) Signed-off-by: Reinhard Tartler <[email protected]> --- libavcodec/flicvideo.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/libavcodec/flicvideo.c b/libavcodec/flicvideo.c index d2cc6cd..0841335 100644 --- a/libavcodec/flicvideo.c +++ b/libavcodec/flicvideo.c @@ -348,6 +348,11 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx, pixel_countdown = s->avctx->width; while (pixel_countdown > 0) { byte_run = sign_extend(bytestream2_get_byte(&g2), 8); + if (!byte_run) { + av_log(avctx, AV_LOG_ERROR, "Invalid byte run value.\n"); + return AVERROR_INVALIDDATA; + } + if (byte_run > 0) { palette_idx1 = bytestream2_get_byte(&g2); CHECK_PIXEL_PTR(byte_run); _______________________________________________ libav-commits mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-commits
