Mercurial > libavformat.hg
diff gifdec.c @ 1787:eb16c64144ee libavformat
This fixes error handling for BeOS, removing the need for some ifdefs.
AVERROR_ defines are moved to avcodec.h as they are needed in there as well. Feel free to move that to avutil/common.h.
Bumped up avcodec/format version numbers as though it's binary compatible we will want to rebuild apps as error values changed.
Please from now on use return AVERROR(EFOO) instead of the ugly return -EFOO in your code.
This also removes the need for berrno.h.
author | mmu_man |
---|---|
date | Tue, 13 Feb 2007 18:26:14 +0000 |
parents | 74cb68ad9dce |
children | b21c2af60bc9 |
line wrap: on
line diff
--- a/gifdec.c Tue Feb 13 08:21:47 2007 +0000 +++ b/gifdec.c Tue Feb 13 18:26:14 2007 +0000 @@ -305,13 +305,13 @@ /* verify that all the image is inside the screen dimensions */ if (left + width > s->screen_width || top + height > s->screen_height) - return -EINVAL; + return AVERROR(EINVAL); /* build the palette */ if (s->pix_fmt == PIX_FMT_RGB24) { line = av_malloc(width); if (!line) - return -ENOMEM; + return AVERROR(ENOMEM); } else { n = (1 << bits_per_pixel); spal = palette; @@ -537,7 +537,7 @@ s->image_linesize = s->screen_width * 3; s->image_buf = av_malloc(s->screen_height * s->image_linesize); if (!s->image_buf) - return -ENOMEM; + return AVERROR(ENOMEM); s->pix_fmt = PIX_FMT_RGB24; /* now we are ready: build format streams */ st = av_new_stream(s1, 0);