aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJai Menon <jmenon86@gmail.com>2010-05-23 19:13:17 +0000
committerJai Menon <jmenon86@gmail.com>2010-05-23 19:13:17 +0000
commit3635c07bd1d1202e98f439f3b5389ff142d87cc3 (patch)
tree1a45b66f00683f5040be155852fa63b36b2e39d1
parent47f0704eb2a10a2ff50c1a118d7a2a92ce38d689 (diff)
downloadffmpeg-3635c07bd1d1202e98f439f3b5389ff142d87cc3.tar.gz
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. Originally committed as revision 23264 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--ffplay.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ffplay.c b/ffplay.c
index a48891e4f2..7b208480f0 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -1591,7 +1591,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];
}