diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2009-02-23 15:18:28 +0000 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2009-02-23 15:18:28 +0000 |
commit | f8c96d011e72f52513c62cec63ae76ff24e4f135 (patch) | |
tree | 24366b59d4862827af16a597664a5ff671f1de2c /libavcodec/utils.c | |
parent | d46b2d682ff5e6a2246f334eb476af98f8cda180 (diff) | |
download | ffmpeg-f8c96d011e72f52513c62cec63ae76ff24e4f135.tar.gz |
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
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 2ae5ce4fd4..f9b9a30049 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]; |