From f8c96d011e72f52513c62cec63ae76ff24e4f135 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Reimar=20D=C3=B6ffinger?= Date: Mon, 23 Feb 2009 15:18:28 +0000 Subject: [PATCH] Check return value of ff_fill_pointer in avcodec_default_get_buffer, if it returns -1 we do not know how to allocate an AVFrame for that format and must return -1 instead of returning nonsense. Originally committed as revision 17542 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/utils.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 2ae5ce4fd..f9b9a3004 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -271,6 +271,8 @@ int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){ } tmpsize = ff_fill_pointer(&picture, NULL, s->pix_fmt, h); + if (tmpsize < 0) + return -1; for (i=0; i<3 && picture.data[i+1]; i++) size[i] = picture.data[i+1] - picture.data[i]; -- 2.11.0