[FFmpeg-devel] [PATCH] mpeg2: fix block_last_index when mismatch control modifies last coeff

Mans Rullgard mans
Mon Jun 21 00:41:32 CEST 2010


---
 libavcodec/mpeg12.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index bc9ddcc..bd579ac 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -939,7 +939,7 @@ end:
     }
     block[63] ^= (mismatch & 1);
 
-    s->block_last_index[n] = i;
+    s->block_last_index[n] = block[63]? 63: i;
     return 0;
 }
 
@@ -1090,7 +1090,7 @@ static inline int mpeg2_decode_block_intra(MpegEncContext *s,
     }
     block[63]^= mismatch&1;
 
-    s->block_last_index[n] = i;
+    s->block_last_index[n] = block[63]? 63: i;
     return 0;
 }
 
-- 
1.7.1




More information about the ffmpeg-devel mailing list