]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/vda_h264.c
Merge commit '34e2ce5dde073244ccb2b62f930e96fe612690f7'
[ffmpeg] / libavcodec / vda_h264.c
index 2bb45c317e3c4bff9463dfb09f082a567ad00004..61fb3c02c959dfce2f7fd4667f89ef98ca684e21 100644 (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;
 }
 
@@ -416,7 +418,7 @@ int ff_vda_default_init(AVCodecContext *avctx)
 
     // kCVPixelFormatType_420YpCbCr8Planar;
 
-    /* Each VCL NAL in the bistream sent to the decoder
+    /* Each VCL NAL in the bitstream sent to the decoder
      * is preceded by a 4 bytes length header.
      * Change the avcC atom header if needed, to signal headers of 4 bytes. */
     if (avctx->extradata_size >= 4 && (avctx->extradata[4] & 0x03) != 0x03) {