mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-04 06:08:26 +02:00
lavc/gifdec: do not return nonzero *got_frame if frame is not passed
Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
aaebdce3d9
commit
285128eedf
@ -409,10 +409,8 @@ static int gif_read_header1(GifState *s)
|
|||||||
return 0;
|
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)) {
|
while (bytestream2_get_bytes_left(&s->gb)) {
|
||||||
int code = bytestream2_get_byte(&s->gb);
|
int code = bytestream2_get_byte(&s->gb);
|
||||||
int ret;
|
int ret;
|
||||||
@ -428,8 +426,7 @@ static int gif_parse_next_image(GifState *s, int *got_picture)
|
|||||||
break;
|
break;
|
||||||
case GIF_TRAILER:
|
case GIF_TRAILER:
|
||||||
/* end of image */
|
/* end of image */
|
||||||
*got_picture = 0;
|
return AVERROR_EOF;
|
||||||
return 0;
|
|
||||||
default:
|
default:
|
||||||
/* erroneous block label */
|
/* erroneous block label */
|
||||||
return AVERROR_INVALIDDATA;
|
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;
|
s->picture.key_frame = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = gif_parse_next_image(s, got_frame);
|
ret = gif_parse_next_image(s);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
else if (*got_frame)
|
|
||||||
*picture = s->picture;
|
*picture = s->picture;
|
||||||
|
*got_frame = 1;
|
||||||
|
|
||||||
return avpkt->size;
|
return avpkt->size;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user