Commit f57a7ac9 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '8aa35009'

* commit '8aa35009':
  mjpeg: Validate sampling factors

Conflicts:
	libavcodec/mjpegdec.c

See: 08c37a10Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 5a65fea6 8aa35009
......@@ -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]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment