[FFmpeg-devel] [PATCH] avcodec/gsm_parser: return -1 on parse error

Chris Cunningham chcunningham at chromium.org
Wed Jan 30 23:44:54 EET 2019

On Wed, Jan 30, 2019 at 1:40 PM James Almer <jamrial at gmail.com> wrote:

> Parsers can't return negative values, only the output packet size. For
> the purpose of errors, they usually return the entire untouched packet
> size.

Understood. Is this documented somewhere? I noted the comment in
av_paser_parse2(), "/* WARNING: the returned index can be negative */", and
guessed that signaled an error.

> And this definitely means there's a bug elsewhere. This parser should
> have not been used for codecs ids other than GSM and GSM_MS. That's
> precisely what this assert() is making sure of.

I'll take a closer look at how this parser was selected.

Thanks for the quick reply.

More information about the ffmpeg-devel mailing list