X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fcpia.c;h=d88bd1aae7be556acbd955bb03a3313b5e75e900;hb=a247ac640df3da573cd661065bf53f37863e2b46;hp=58833b2f26706d84ada6a9c1754609ca3629caa4;hpb=8e789d244cc946bc350672eeb02453918b21a09f;p=ffmpeg diff --git a/libavcodec/cpia.c b/libavcodec/cpia.c index 58833b2f267..d88bd1aae7b 100644 --- a/libavcodec/cpia.c +++ b/libavcodec/cpia.c @@ -63,7 +63,7 @@ static int cpia_decode_frame(AVCodecContext *avctx, uint8_t *y, *u, *v, *y_end, *u_end, *v_end; // Check header - if ( avpkt->size < FRAME_HEADER_SIZE + if ( avpkt->size < FRAME_HEADER_SIZE + avctx->height * 3 || header[0] != MAGIC_0 || header[1] != MAGIC_1 || (header[17] != SUBSAMPLE_420 && header[17] != SUBSAMPLE_422) || (header[18] != YUVORDER_YUYV && header[18] != YUVORDER_UYVY) @@ -100,7 +100,7 @@ static int cpia_decode_frame(AVCodecContext *avctx, } // Get buffer filled with previous frame - if ((ret = ff_reget_buffer(avctx, frame)) < 0) + if ((ret = ff_reget_buffer(avctx, frame, 0)) < 0) return ret; @@ -220,7 +220,7 @@ static av_cold int cpia_decode_end(AVCodecContext *avctx) return 0; } -AVCodec ff_cpia_decoder = { +const AVCodec ff_cpia_decoder = { .name = "cpia", .long_name = NULL_IF_CONFIG_SMALL("CPiA video format"), .type = AVMEDIA_TYPE_VIDEO, @@ -230,4 +230,5 @@ AVCodec ff_cpia_decoder = { .close = cpia_decode_end, .decode = cpia_decode_frame, .capabilities = AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, };