]> git.sesse.net Git - vlc/commitdiff
video_filter: colorthres.c: check return value of GetPackedYuvOffsets()
authorJean-Paul Saman <jean-paul.saman@m2x.nl>
Tue, 7 Sep 2010 16:21:24 +0000 (18:21 +0200)
committerJean-Paul Saman <jean-paul.saman@m2x.nl>
Tue, 7 Sep 2010 16:45:12 +0000 (18:45 +0200)
Check return value of GetPackedYuvOffsets().

modules/video_filter/colorthres.c

index c6c44e071cc8aee2338068cd7a8061bd77aedc66..eecbe20ac0bc7d4ab68bf263161b57eee994f0af 100644 (file)
@@ -287,9 +287,14 @@ static picture_t *FilterPacked( filter_t *p_filter, picture_t *p_pic )
         return NULL;
     }
 
-    int i_y_offset = 0, i_u_offset = 0, i_v_offset = 0;
-    GetPackedYuvOffsets( p_filter->fmt_in.video.i_chroma,
-                         &i_y_offset, &i_u_offset, &i_v_offset );
+    int i_y_offset, i_u_offset, i_v_offset;
+    int i_ret = GetPackedYuvOffsets( p_filter->fmt_in.video.i_chroma,
+                                     &i_y_offset, &i_u_offset, &i_v_offset );
+    if( i_ret == VLC_EGENERIC )
+    {
+        picture_Release( p_pic );
+        return NULL;
+    }
 
     /*
      * Copy Y and do the U and V planes