[FFmpeg-devel] [PATCH] avformat/oggdec: only parse headers before data

Michael Niedermayer michael at niedermayer.cc
Wed Jun 19 21:25:09 EEST 2019


On Mon, Jun 17, 2019 at 05:59:40PM -0700, Chris Cunningham wrote:
> This behavior was added in 2010 to suport some old (and invalid) ogm
> files. https://github.com/FFmpeg/FFmpeg/commit/81b743eb1026547270b88ac6a5cb451a3907ee94
> 
> But this makes it possible to change the codec in the later headers,
> causing codec to be out of sync with internal avctx (eventually
> triggering Abrt). Updating the internal ctx for this degenerate case
> was deemed not worth it. See discussion here:
> https://patchwork.ffmpeg.org/patch/11983/
> ---
>  libavformat/oggdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
> index e815f42134..19d77f3107 100644
> --- a/libavformat/oggdec.c
> +++ b/libavformat/oggdec.c
> @@ -545,7 +545,7 @@ static int ogg_packet(AVFormatContext *s, int *sid, int *dstart, int *dsize,
>      ogg->curidx    = idx;
>      os->incomplete = 0;
>  
> -    if (os->header) {
> +    if (!ogg->headers) {
>          if ((ret = os->codec->header(s, idx)) < 0) {
>              av_log(s, AV_LOG_ERROR, "Header processing failed: %s\n", av_err2str(ret));
>              return ret;

breaks:
./ffmpeg -i bgc.sub.dub.ogm -vframes 3 -y test.webm
sample: http://samples.mplayerhq.hu/ogg/bgc.sub.dub.ogm

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190619/10a194a4/attachment.sig>


More information about the ffmpeg-devel mailing list