Browse Source

lavc/decode_video(): always unref the frame if there is no output in decode_video

Not just on failure. This is the same thing that is done in the audio
path and should prevent leaks in decoders that allocate a frame, but
then end up not writing into it.
tags/n2.2-rc1
Anton Khirnov 12 years ago
parent
commit
a1ee164869
1 changed files with 2 additions and 4 deletions
  1. +2
    -4
      libavcodec/utils.c

+ 2
- 4
libavcodec/utils.c View File

@@ -1416,9 +1416,6 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi

emms_c(); //needed to avoid an emms_c() call before every return;

if (ret < 0 && picture->buf[0])
av_frame_unref(picture);

if (*got_picture_ptr) {
if (!avctx->refcounted_frames) {
avci->to_free = *picture;
@@ -1427,7 +1424,8 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
}

avctx->frame_number++;
}
} else
av_frame_unref(picture);
} else
ret = 0;



Loading…
Cancel
Save