Mercurial > libavcodec.hg
comparison utils.c @ 9014:1de11a984fc6 libavcodec
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.
| author | reimar |
|---|---|
| date | Mon, 23 Feb 2009 15:18:28 +0000 |
| parents | 90c99bda19f5 |
| children | c7d783120b99 |
comparison
equal
deleted
inserted
replaced
| 9013:b54938038170 | 9014:1de11a984fc6 |
|---|---|
| 269 stride_align[i] = STRIDE_ALIGN; | 269 stride_align[i] = STRIDE_ALIGN; |
| 270 picture.linesize[i] = ALIGN(picture.linesize[i], stride_align[i]); | 270 picture.linesize[i] = ALIGN(picture.linesize[i], stride_align[i]); |
| 271 } | 271 } |
| 272 | 272 |
| 273 tmpsize = ff_fill_pointer(&picture, NULL, s->pix_fmt, h); | 273 tmpsize = ff_fill_pointer(&picture, NULL, s->pix_fmt, h); |
| 274 if (tmpsize < 0) | |
| 275 return -1; | |
| 274 | 276 |
| 275 for (i=0; i<3 && picture.data[i+1]; i++) | 277 for (i=0; i<3 && picture.data[i+1]; i++) |
| 276 size[i] = picture.data[i+1] - picture.data[i]; | 278 size[i] = picture.data[i+1] - picture.data[i]; |
| 277 size[i] = tmpsize - (picture.data[i] - picture.data[0]); | 279 size[i] = tmpsize - (picture.data[i] - picture.data[0]); |
| 278 | 280 |
