[FFmpeg-devel] [PATCH] mpeg12dec: don't assert on unknown chroma format
Hendrik Leppkes
h.leppkes at gmail.com
Wed Sep 30 14:45:31 CEST 2015
The chroma format can be still unset in postinit when a badly cut stream
starts with a slice instead of a sequence header. This is a common
occurance when feeding avcodec from a Live TV stream.
---
libavcodec/mpeg12dec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index 5d916d1..76bf60f 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -1389,7 +1389,7 @@ static int mpeg_decode_postinit(AVCodecContext *avctx)
case 1: avctx->chroma_sample_location = AVCHROMA_LOC_LEFT; break;
case 2:
case 3: avctx->chroma_sample_location = AVCHROMA_LOC_TOPLEFT; break;
- default: av_assert0(0);
+ default: return AVERROR(EINVAL);
}
} // MPEG-2
--
2.5.3.windows.1
More information about the ffmpeg-devel
mailing list