summaryrefslogtreecommitdiffstats
path: root/libavcodec/mpeg12.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-03-18 17:43:43 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-03-18 17:43:43 +0100
commit330e440706665d91f36f180f25fa096a8b3e7ed4 (patch)
treeca9e7fe58b74cc4d7f9ad04427faff8a311ff40d /libavcodec/mpeg12.c
parent523c8e0503dcf99f67ea909dea2ca5e56d9ff091 (diff)
parent358628074c314c8ec6d433a740e9176e7aefa124 (diff)
downloadffmpeg-streaming-330e440706665d91f36f180f25fa096a8b3e7ed4.zip
ffmpeg-streaming-330e440706665d91f36f180f25fa096a8b3e7ed4.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: print_options: do not generate docs for options without enc or dec flags mpeg12: do not fail on zero dimensions in the sequence header. Conflicts: libavcodec/mpeg12.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpeg12.c')
-rw-r--r--libavcodec/mpeg12.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index 4a83cfd..3f5548d 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -2026,6 +2026,12 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx,
width = get_bits(&s->gb, 12);
height = get_bits(&s->gb, 12);
+ if (width == 0 || height == 0) {
+ av_log(avctx, AV_LOG_WARNING, "Invalid horizontal or vertical size "
+ "value.\n");
+ if (avctx->err_recognition & AV_EF_BITSTREAM)
+ return AVERROR_INVALIDDATA;
+ }
s->aspect_ratio_info = get_bits(&s->gb, 4);
if (s->aspect_ratio_info == 0) {
av_log(avctx, AV_LOG_ERROR, "aspect ratio has forbidden 0 value\n");
@@ -2343,7 +2349,8 @@ static int decode_chunks(AVCodecContext *avctx,
picture_start_code_seen = 1;
if (s2->width <= 0 || s2->height <= 0) {
- av_log(avctx, AV_LOG_ERROR, "%dx%d is invalid\n", s2->width, s2->height);
+ av_log(avctx, AV_LOG_ERROR, "Invalid frame dimensions %dx%d.\n",
+ s2->width, s2->height);
return AVERROR_INVALIDDATA;
}
OpenPOWER on IntegriCloud