avcodec/vda_h264: fix null pointer dereference

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-05-12 02:25:58 +02:00
parent 5449239a03
commit 2856332719
1 changed files with 5 additions and 3 deletions

View File

@ -274,9 +274,11 @@ int ff_vda_destroy_decoder(struct vda_context *vda_ctx)
static int vda_h264_uninit(AVCodecContext *avctx)
{
VDAContext *vda = avctx->internal->hwaccel_priv_data;
av_freep(&vda->bitstream);
if (vda->frame)
CVPixelBufferRelease(vda->frame);
if (vda) {
av_freep(&vda->bitstream);
if (vda->frame)
CVPixelBufferRelease(vda->frame);
}
return 0;
}