[FFmpeg-cvslog] vp56dec: Fix handling of alpha configuration changes.

Michael Niedermayer git at videolan.org
Fri Nov 9 17:26:53 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Nov  9 16:58:53 2012 +0100| [9195377bc5818b65b34556938749d97eecde413b] | committer: Michael Niedermayer

vp56dec: Fix handling of alpha configuration changes.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/vp56.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c
index 1e373aa..3002fc1 100644
--- a/libavcodec/vp56.c
+++ b/libavcodec/vp56.c
@@ -552,7 +552,16 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
 
         res = s->alpha_context->parse_header(s->alpha_context, buf, remaining_buf_size);
         if (res != 1) {
-            avctx->release_buffer(avctx, p);
+            if(res==2) {
+                av_log(avctx, AV_LOG_ERROR, "Alpha reconfiguration\n");
+                for (i = 0; i < 4; i++) {
+                    if (s->frames[i].data[0])
+                        avctx->release_buffer(avctx, &s->frames[i]);
+                    av_assert0(!s->alpha_context->frames[i].data[0]);
+                }
+                vp56_size_changed(s);
+            }else
+                avctx->release_buffer(avctx, p);
             return -1;
         }
     }



More information about the ffmpeg-cvslog mailing list