aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpeg12enc.c
diff options
context:
space:
mode:
authorAlex Converse <alex.converse@gmail.com>2011-11-03 15:56:37 -0700
committerAlex Converse <alex.converse@gmail.com>2011-11-07 10:50:48 -0800
commit7c5dfc174be59afa671a98ec85fe208c528ab64f (patch)
tree6ecc31caa894644e06291b23bc9a1c6b23e5b5ba /libavcodec/mpeg12enc.c
parenta1684cf82d1aa35de0ae97724477501f92395c2b (diff)
downloadffmpeg-7c5dfc174be59afa671a98ec85fe208c528ab64f.tar.gz
mpeg12enc: Don't set up run-level info for level 0.
run: The number of zero coefficients preceding a non-zero coefficient, in the scan order. The absolute value of the non-zero coefficient is called "level". The run-level code makes illegal reads when trying to set up tables for nonsense level 0.
Diffstat (limited to 'libavcodec/mpeg12enc.c')
-rw-r--r--libavcodec/mpeg12enc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c
index 5dedabd268..26d26c7217 100644
--- a/libavcodec/mpeg12enc.c
+++ b/libavcodec/mpeg12enc.c
@@ -74,6 +74,8 @@ static void init_uni_ac_vlc(RLTable *rl, uint8_t *uni_ac_vlc_len){
for(i=0; i<128; i++){
int level= i-64;
int run;
+ if (!level)
+ continue;
for(run=0; run<64; run++){
int len, bits, code;