X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fnuv.c;h=bb80e3e88497b42585fa52c0e7e40de6e1633ce8;hb=11cfff04eda73a4ba92eb13bc0d09cbd224cd9e3;hp=32ed65899b13ddcf2b018a8dc829b994c4e5c7c6;hpb=52b44e9d15c0ee3c118ed68a0c2c737a9eb50ae9;p=ffmpeg diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c index 32ed65899b1..bb80e3e8849 100644 --- a/libavcodec/nuv.c +++ b/libavcodec/nuv.c @@ -162,6 +162,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, int keyframe, ret; int size_change = 0; int minsize = 0; + int flags = 0; int result, init_frame = !avctx->frame_number; enum { NUV_UNCOMPRESSED = '0', @@ -204,6 +205,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, } break; case NUV_COPY_LAST: + flags |= FF_REGET_BUFFER_FLAG_READONLY; keyframe = 0; break; default: @@ -268,7 +270,7 @@ retry: init_frame = 1; } - if ((result = ff_reget_buffer(avctx, c->pic)) < 0) + if ((result = ff_reget_buffer(avctx, c->pic, flags)) < 0) return result; if (init_frame) { memset(c->pic->data[0], 0, avctx->height * c->pic->linesize[0]); @@ -365,4 +367,5 @@ AVCodec ff_nuv_decoder = { .close = decode_end, .decode = decode_frame, .capabilities = AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, };