aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ffv1.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-07-16 15:41:40 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-07-16 15:48:04 +0200
commitac9389a6633dd4bb355f7c0419bd0af7da22e308 (patch)
treeff1cc5a15f11aacfb8e2e9ac395a574439aa8f7b /libavcodec/ffv1.c
parentb0d674ec1063484de4df9594ad409021350adef3 (diff)
downloadandroid_external_ffmpeg-ac9389a6633dd4bb355f7c0419bd0af7da22e308.tar.gz
android_external_ffmpeg-ac9389a6633dd4bb355f7c0419bd0af7da22e308.tar.bz2
android_external_ffmpeg-ac9389a6633dd4bb355f7c0419bd0af7da22e308.zip
ffv1dec: detect errors in bytestream end mismatches for EC
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ffv1.c')
-rw-r--r--libavcodec/ffv1.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c
index 41c27cea06..3160817cbc 100644
--- a/libavcodec/ffv1.c
+++ b/libavcodec/ffv1.c
@@ -1648,6 +1648,13 @@ static int decode_slice(AVCodecContext *c, void *arg){
}else{
decode_rgb_frame(fs, (uint32_t*)p->data[0] + ps*x + y*(p->linesize[0]/4), width, height, p->linesize[0]/4);
}
+ if(fs->ac && f->version > 2) {
+ int v = fs->c.bytestream_end - fs->c.bytestream - 3 - 5*f->ec;
+ if(v != -1 && v!= 0) {
+ av_log(f->avctx, AV_LOG_ERROR, "bytestream end mismatching by %d\n", v);
+ fs->slice_damaged = 1;
+ }
+ }
emms_c();