1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-09-29 16:23:10 +02:00

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
This commit is contained in:
Jai Menon 2010-05-23 19:13:17 +00:00
parent 47f0704eb2
commit 3635c07bd1

View File

@ -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];
}