]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/xxan.c
avformat/aviobuf: End grace period of allowing 0 from read_packet
[ffmpeg] / libavcodec / xxan.c
index afe60e156477de2f60257919a448314dcf4c71bc..1dd46b36ebd5901e117cd3be7028e02e5b62c932 100644 (file)
@@ -71,16 +71,12 @@ static av_cold int xan_decode_init(AVCodecContext *avctx)
     if (!s->y_buffer)
         return AVERROR(ENOMEM);
     s->scratch_buffer = av_malloc(s->buffer_size + 130);
-    if (!s->scratch_buffer) {
-        xan_decode_end(avctx);
+    if (!s->scratch_buffer)
         return AVERROR(ENOMEM);
-    }
 
     s->pic = av_frame_alloc();
-    if (!s->pic) {
-        xan_decode_end(avctx);
+    if (!s->pic)
         return AVERROR(ENOMEM);
-    }
 
     return 0;
 }
@@ -447,4 +443,5 @@ AVCodec ff_xan_wc4_decoder = {
     .close          = xan_decode_end,
     .decode         = xan_decode_frame,
     .capabilities   = AV_CODEC_CAP_DR1,
+    .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE,
 };