diff --git a/libavcodec/flac_parser.c b/libavcodec/flac_parser.c index 50ad72b7c0..dac1c26c7e 100644 --- a/libavcodec/flac_parser.c +++ b/libavcodec/flac_parser.c @@ -646,7 +646,7 @@ static int flac_parse(AVCodecParserContext *s, AVCodecContext *avctx, handle_error: *poutbuf = NULL; *poutbuf_size = 0; - return read_end - buf; + return buf_size ? read_end - buf : 0; } static int flac_parse_init(AVCodecParserContext *c)