X-Git-Url: https://git.piment-noir.org/?p=deb_ffmpeg.git;a=blobdiff_plain;f=ffmpeg%2Flibavcodec%2Ffic.c;h=adc8a25d4c979e04da25905a622b3b15981c5aba;hp=5615e69abce7e1a97a0d2e99d0f79ca32f3cadc0;hb=f6fa7814ccfe3e76514b36cf04f5cd3cb657c8cf;hpb=2ba45a602cbfa7b771effba9b11bb4245c21bc00 diff --git a/ffmpeg/libavcodec/fic.c b/ffmpeg/libavcodec/fic.c index 5615e69..adc8a25 100644 --- a/ffmpeg/libavcodec/fic.c +++ b/ffmpeg/libavcodec/fic.c @@ -308,7 +308,10 @@ static int fic_decode_frame(AVCodecContext *avctx, void *data, return AVERROR_INVALIDDATA; } - if (tsize < 32) { + if (!tsize) + skip_cursor = 1; + + if (!skip_cursor && tsize < 32) { av_log(avctx, AV_LOG_WARNING, "Cursor data too small. Skipping cursor.\n"); skip_cursor = 1; @@ -317,14 +320,14 @@ static int fic_decode_frame(AVCodecContext *avctx, void *data, /* Cursor position. */ cur_x = AV_RL16(src + 33); cur_y = AV_RL16(src + 35); - if (cur_x > avctx->width || cur_y > avctx->height) { + if (!skip_cursor && (cur_x > avctx->width || cur_y > avctx->height)) { av_log(avctx, AV_LOG_WARNING, "Invalid cursor position: (%d,%d). Skipping cusor.\n", cur_x, cur_y); skip_cursor = 1; } - if (AV_RL16(src + 37) != 32 || AV_RL16(src + 39) != 32) { + if (!skip_cursor && (AV_RL16(src + 37) != 32 || AV_RL16(src + 39) != 32)) { av_log(avctx, AV_LOG_WARNING, "Invalid cursor size. Skipping cursor.\n"); skip_cursor = 1;