Browse Source

avcodec/mjpegenc_huffman: Assert length in ff_mjpegenc_huffman_compute_bits()

This should help coverity see that the issues this leads to cannot occur

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.4
Michael Niedermayer 8 years ago
parent
commit
8dd0c12648
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      libavcodec/mjpegenc_huffman.c

+ 2
- 0
libavcodec/mjpegenc_huffman.c View File

@@ -87,6 +87,8 @@ void ff_mjpegenc_huffman_compute_bits(PTable *prob_table, HuffTable *distincts,

int min;

av_assert0(max_length > 0);

to->nitems = 0;
from->nitems = 0;
to->item_idx[0] = 0;


Loading…
Cancel
Save