X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Ffic.c;h=95baaedaa5e18b90a50fd1c64ec85fe531197682;hb=2e328a8a38e06e4737bc1253a568558a7c514e77;hp=65d102b86bea25f8bdc982889c50b2277342710b;hpb=44085b9951b06df1cab4105dcda004213988d84f;p=ffmpeg diff --git a/libavcodec/fic.c b/libavcodec/fic.c index 65d102b86be..95baaedaa5e 100644 --- a/libavcodec/fic.c +++ b/libavcodec/fic.c @@ -278,7 +278,7 @@ static int fic_decode_frame(AVCodecContext *avctx, void *data, int skip_cursor = ctx->skip_cursor; uint8_t *sdata; - if ((ret = ff_reget_buffer(avctx, ctx->frame)) < 0) + if ((ret = ff_reget_buffer(avctx, ctx->frame, 0)) < 0) return ret; /* Header + at least one slice (4) */ @@ -356,7 +356,7 @@ static int fic_decode_frame(AVCodecContext *avctx, void *data, sdata = src + tsize + FIC_HEADER_SIZE + 4 * nslices; msize = avpkt->size - nslices * 4 - tsize - FIC_HEADER_SIZE; - if (msize <= 0) { + if (msize <= ctx->aligned_width/8 * (ctx->aligned_height/8) / 8) { av_log(avctx, AV_LOG_ERROR, "Not enough frame data to decode.\n"); return AVERROR_INVALIDDATA; } @@ -421,7 +421,7 @@ static int fic_decode_frame(AVCodecContext *avctx, void *data, } /* Make sure we use a user-supplied buffer. */ - if ((ret = ff_reget_buffer(avctx, ctx->final_frame)) < 0) { + if ((ret = ff_reget_buffer(avctx, ctx->final_frame, 0)) < 0) { av_log(avctx, AV_LOG_ERROR, "Could not make frame writable.\n"); return ret; }