[FFmpeg-cvslog] avutil/pixdesc: check step/depth against each other

Michael Niedermayer git at videolan.org
Tue Apr 16 15:22:54 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Apr 16 14:36:49 2013 +0200| [f807d6d2009b9f2e70d9a204a0e8b6140a87ec85] | committer: Michael Niedermayer

avutil/pixdesc: check step/depth against each other

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f807d6d2009b9f2e70d9a204a0e8b6140a87ec85
---

 libavutil/pixdesc.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index c03964f..39e7d69 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -1848,8 +1848,15 @@ void ff_check_pixfmt_descriptors(void){
 
         for (j=0; j<FF_ARRAY_ELEMS(d->comp); j++) {
             const AVComponentDescriptor *c = &d->comp[j];
-            if(j>=d->nb_components)
+            if(j>=d->nb_components) {
                 av_assert0(!c->plane && !c->step_minus1 && !c->offset_plus1 && !c->shift && !c->depth_minus1);
+                continue;
+            }
+            if (d->flags & PIX_FMT_BITSTREAM) {
+                av_assert0(c->step_minus1 >= c->depth_minus1);
+            } else {
+                av_assert0(8*(c->step_minus1+1) >= c->depth_minus1+1);
+            }
         }
     }
 }



More information about the ffmpeg-cvslog mailing list