diff options
author | Reinhard Tartler <siretart@tauware.de> | 2010-05-25 20:55:57 +0000 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2010-05-25 20:55:57 +0000 |
commit | 2c3439b0089f45051970689df7f75e0aa16ad5a6 (patch) | |
tree | bde6f99f105c24161e823b03829e00217bb3bfb2 | |
parent | cdfe333493f54edc4d27ac88fd31f81acdd45954 (diff) |
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
Originally committed as revision 23326 to svn://svn.ffmpeg.org/ffmpeg/branches/0.6
-rw-r--r-- | ffplay.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -1593,7 +1593,9 @@ static int input_get_buffer(AVCodecContext *codec, AVFrame *pic) 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]; } |