aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-05-21 10:49:21 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-05-21 10:50:03 +0200
commitf57a7ac9b8e0e55e3722ea82c084ff7d7dc2b2fd (patch)
treef2bbe85f6038dc86431bc21873119ab62aa68708 /libavcodec
parent5a65fea655fb2558a3004a93f782c1534dd6a363 (diff)
parent8aa3500905fec6c4e657bb291b861d43c34d3de9 (diff)
downloadffmpeg-f57a7ac9b8e0e55e3722ea82c084ff7d7dc2b2fd.tar.gz
Merge commit '8aa3500905fec6c4e657bb291b861d43c34d3de9'
* commit '8aa3500905fec6c4e657bb291b861d43c34d3de9': mjpeg: Validate sampling factors Conflicts: libavcodec/mjpegdec.c See: 08c37a10e9ef7e30d7b7a889ad28c7fa9c49c886 Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mjpegdec.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index b2802ffaab..214b22182d 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -280,15 +280,18 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
s->h_max = h_count[i];
if (v_count[i] > s->v_max)
s->v_max = v_count[i];
- if (!h_count[i] || !v_count[i]) {
- av_log(s->avctx, AV_LOG_ERROR, "h/v_count is 0\n");
- return -1;
- }
s->quant_index[i] = get_bits(&s->gb, 8);
if (s->quant_index[i] >= 4) {
av_log(s->avctx, AV_LOG_ERROR, "quant_index is invalid\n");
return AVERROR_INVALIDDATA;
}
+ if (!h_count[i] || !v_count[i]) {
+ av_log(s->avctx, AV_LOG_ERROR,
+ "Invalid sampling factor in component %d %d:%d\n",
+ i, h_count[i], v_count[i]);
+ return AVERROR_INVALIDDATA;
+ }
+
av_log(s->avctx, AV_LOG_DEBUG, "component %d %d:%d id: %d quant:%d\n",
i, h_count[i], v_count[i],
s->component_id[i], s->quant_index[i]);