[FFmpeg-devel] [PATCH] avcodec/snowdec: Check intra block dc differences.
Ronald S. Bultje
rsbultje at gmail.com
Tue Sep 5 05:00:36 EEST 2017
Hi,
On Mon, Sep 4, 2017 at 12:11 PM, Michael Niedermayer <michael at niedermayer.cc
> wrote:
> if(type){
> + int ld, cbd, crd;
> pred_mv(s, &mx, &my, 0, left, top, tr);
> - l += get_symbol(&s->c, &s->block_state[32], 1);
> + ld = get_symbol(&s->c, &s->block_state[32], 1);
> + if (ld < -255 || ld > 255) {
> + av_log(s->avctx, AV_LOG_ERROR, "Invalid (Out of range)
> intra luma block DC difference %d\n", ld);
> + return AVERROR_INVALIDDATA;
> + }
> + l += ld;
> if (s->nb_planes > 2) {
> - cb+= get_symbol(&s->c, &s->block_state[64], 1);
> - cr+= get_symbol(&s->c, &s->block_state[96], 1);
> + cbd = get_symbol(&s->c, &s->block_state[64], 1);
> + crd = get_symbol(&s->c, &s->block_state[96], 1);
> + if (cbd < -255 || cbd > 255 || crd < -255 || crd > 255) {
> + av_log(s->avctx, AV_LOG_ERROR, "Invalid (Out of
> range) intra chroma block DC difference %d, %d\n", cbd, crd);
> + return AVERROR_INVALIDDATA;
> + }
> + cb += cbd;
> + cr += crd;
> }
I recognize the great improvements in your messages. They are much better
than before. They are still not appropriate for display to end users.
Please use ff_tlog(), as was suggested in the original thread.
Ronald
More information about the ffmpeg-devel
mailing list