[vlc-commits] commit: video_filter: colorthres.c: check return value of GetPackedYuvOffsets() (Jean-Paul Saman )

git at videolan.org git at videolan.org
Tue Sep 7 19:00:57 CEST 2010


vlc | branch: master | Jean-Paul Saman <jean-paul.saman at m2x.nl> | Tue Sep  7 18:21:24 2010 +0200| [7a7cdf7d0538d6d8645d8b21a12f31be54915e06] | committer: Jean-Paul Saman 

video_filter: colorthres.c: check return value of GetPackedYuvOffsets()

Check return value of GetPackedYuvOffsets().

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7a7cdf7d0538d6d8645d8b21a12f31be54915e06
---

 modules/video_filter/colorthres.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/modules/video_filter/colorthres.c b/modules/video_filter/colorthres.c
index c6c44e0..eecbe20 100644
--- a/modules/video_filter/colorthres.c
+++ b/modules/video_filter/colorthres.c
@@ -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



More information about the vlc-commits mailing list