Browse Source

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
tags/v0.5
Reimar Döffinger 16 years ago
parent
commit
f8c96d011e
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      libavcodec/utils.c

+ 2
- 0
libavcodec/utils.c View File

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


Loading…
Cancel
Save