]> git.sesse.net Git - vlc/blobdiff - modules/codec/vpx.c
vpx: fix leak
[vlc] / modules / codec / vpx.c
index ef151f209da845a247bc4ca11f77149bef926339..1707e72db7dbb12f6d7f5057d2d223c08e6c279f 100644 (file)
@@ -103,8 +103,10 @@ static picture_t *Decode(decoder_t *dec, block_t **pp_block)
 
     const void *iter = NULL;
     struct vpx_image *img = vpx_codec_get_frame(ctx, &iter);
-    if (!img)
+    if (!img) {
+        free(pkt_pts);
         return NULL;
+    }
 
     /* fetches back the PTS */
     pkt_pts = img->user_priv;
@@ -158,10 +160,12 @@ static int Open(vlc_object_t *p_this)
 
     switch (dec->fmt_in.i_codec)
     {
+#ifdef ENABLE_VP8_DECODER
     case VLC_CODEC_VP8:
         iface = &vpx_codec_vp8_dx_algo;
         vp_version = 8;
         break;
+#endif
 #ifdef ENABLE_VP9_DECODER
     case VLC_CODEC_VP9:
         iface = &vpx_codec_vp9_dx_algo;