diff options
author | Paul B Mahol <onemda@gmail.com> | 2013-01-25 12:15:13 +0000 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2013-01-25 12:54:14 +0000 |
commit | 285128eedf9efa9bd3cae1a5b79cb97bd05bb104 (patch) | |
tree | e81a25cff28a6a6294aa6878453e29751d698ecd | |
parent | aaebdce3d90725ff93a31678690a306da6e12bbb (diff) | |
download | ffmpeg-285128eedf9efa9bd3cae1a5b79cb97bd05bb104.tar.gz |
lavc/gifdec: do not return nonzero *got_frame if frame is not passed
Signed-off-by: Paul B Mahol <onemda@gmail.com>
-rw-r--r-- | libavcodec/gifdec.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c index bd4c22d1e5..90aaa46e85 100644 --- a/libavcodec/gifdec.c +++ b/libavcodec/gifdec.c @@ -409,10 +409,8 @@ static int gif_read_header1(GifState *s) return 0; } -static int gif_parse_next_image(GifState *s, int *got_picture) +static int gif_parse_next_image(GifState *s) { - - *got_picture = 1; while (bytestream2_get_bytes_left(&s->gb)) { int code = bytestream2_get_byte(&s->gb); int ret; @@ -428,8 +426,7 @@ static int gif_parse_next_image(GifState *s, int *got_picture) break; case GIF_TRAILER: /* end of image */ - *got_picture = 0; - return 0; + return AVERROR_EOF; default: /* erroneous block label */ return AVERROR_INVALIDDATA; @@ -507,11 +504,12 @@ static int gif_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, A s->picture.key_frame = 0; } - ret = gif_parse_next_image(s, got_frame); + ret = gif_parse_next_image(s); if (ret < 0) return ret; - else if (*got_frame) - *picture = s->picture; + + *picture = s->picture; + *got_frame = 1; return avpkt->size; } |