[FFmpeg-devel] [PATCH]Do not allow rv40 size-change if threads>1

Carl Eugen Hoyos cehoyos at ag.or.at
Tue Feb 14 00:11:21 CET 2012


Hi!

I don't know if this is correct / sufficient, but something similar is done 
for H264.
Fixes a crash with the sample from bug 220.

Please review, Carl Eugen
-------------- next part --------------
diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c
index e09d5dc..1d57a68 100644
--- a/libavcodec/rv34.c
+++ b/libavcodec/rv34.c
@@ -1377,6 +1377,10 @@ static int rv34_decode_slice(RV34DecContext *r, int end, const uint8_t* buf, int
 
     if ((s->mb_x == 0 && s->mb_y == 0) || s->current_picture_ptr==NULL) {
         if(s->width != r->si.width || s->height != r->si.height){
+            if(s->avctx->active_thread_type & FF_THREAD_FRAME) {
+                av_log_missing_feature(s->avctx, "Width/height changing with threads is", 0);
+                return -1;
+            }
             av_log(s->avctx, AV_LOG_DEBUG, "Changing dimensions to %dx%d\n", r->si.width,r->si.height);
             MPV_common_end(s);
             s->width  = r->si.width;


More information about the ffmpeg-devel mailing list