[FFmpeg-cvslog] ffv1: Always store slice size when error reobustness is enabled.

Michael Niedermayer git at videolan.org
Wed Apr 25 12:18:02 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Apr 25 12:01:44 2012 +0200| [0c278545321373b5bdff926adc0f645c319872a2] | committer: Michael Niedermayer

ffv1: Always store slice size when error reobustness is enabled.

This simplifies finding slices within a damaged bitstream.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0c278545321373b5bdff926adc0f645c319872a2
---

 libavcodec/ffv1.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c
index 3a957b1..5e8fd18 100644
--- a/libavcodec/ffv1.c
+++ b/libavcodec/ffv1.c
@@ -1290,7 +1290,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
             flush_put_bits(&fs->pb); //nicer padding FIXME
             bytes= fs->ac_byte_count + (put_bits_count(&fs->pb)+7)/8;
         }
-        if(i>0){
+        if(i>0 || f->ec){
             av_assert0(bytes < pkt->size/f->slice_count);
             memmove(buf_p, fs->c.bytestream_start, bytes);
             av_assert0(bytes < (1<<24));
@@ -1990,8 +1990,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
         int trailer = 3 + 4*!!f->ec;
         int v;
 
-        if(i) v = AV_RB24(buf_p-trailer)+trailer;
-        else  v = buf_p - c->bytestream_start;
+        if(i || f->ec) v = AV_RB24(buf_p-trailer)+trailer;
+        else           v = buf_p - c->bytestream_start;
         if(buf_p - c->bytestream_start < v){
             av_log(avctx, AV_LOG_ERROR, "Slice pointer chain broken\n");
             return -1;



More information about the ffmpeg-cvslog mailing list