Commit 753057f5 authored by jai_menon's avatar jai_menon

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.



git-svn-id: file:///var/local/repositories/ffmpeg/trunk@23264 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent ff27cfb9
......@@ -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];
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment