[FFmpeg-cvslog] r23326 - in branches/0.6: . ffplay.c

siretart subversion
Tue May 25 22:55:57 CEST 2010


Author: siretart
Date: Tue May 25 22:55:57 2010
New Revision: 23326

Log:
FFplay : Avoid manipulating NULL data pointers so that future checks 
remain valid. This fixes segfaults for those cases where data copy to 
this invalid pointer is attempted.



backport r23264 by jai_menon

Modified:
   branches/0.6/   (props changed)
   branches/0.6/ffplay.c

Modified: branches/0.6/ffplay.c
==============================================================================
--- branches/0.6/ffplay.c	Tue May 25 21:23:18 2010	(r23325)
+++ branches/0.6/ffplay.c	Tue May 25 22:55:57 2010	(r23326)
@@ -1593,7 +1593,9 @@ static int input_get_buffer(AVCodecConte
         unsigned hshift = i == 0 ? 0 : av_pix_fmt_descriptors[ref->pic->format].log2_chroma_w;
         unsigned vshift = i == 0 ? 0 : av_pix_fmt_descriptors[ref->pic->format].log2_chroma_h;
 
+        if (ref->data[i]) {
         ref->data[i]    += (edge >> hshift) + ((edge * ref->linesize[i]) >> vshift);
+        }
         pic->data[i]     = ref->data[i];
         pic->linesize[i] = ref->linesize[i];
     }



More information about the ffmpeg-cvslog mailing list