Skip to content
Browse files

mjpegdec: print error message when quant_index is invalid

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  • Loading branch information...
1 parent a2f680c commit bc16031a410e0a77927f0604560aa9c803df26b2 @michaelni michaelni committed Nov 30, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 libavcodec/mjpegdec.c
View
4 libavcodec/mjpegdec.c
@@ -283,8 +283,10 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
return -1;
}
s->quant_index[i] = get_bits(&s->gb, 8);
- if (s->quant_index[i] >= 4)
+ if (s->quant_index[i] >= 4) {
+ av_log(s->avctx, AV_LOG_ERROR, "quant_index is invalid\n");
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]);

0 comments on commit bc16031

Please sign in to comment.
Something went wrong with that request. Please try again.