diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 86d9b6f586a8122914708cb6db50872988742a0d..b84c90533715e975ce81976c0481ad37ccea9a37 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -426,6 +426,7 @@ typedef struct AVCodecContext {
 #define FF_BUG_UMP4             8
 #define FF_BUG_NO_PADDING       16
 #define FF_BUG_AC_VLC           32
+#define FF_BUG_QPEL_CHROMA      64
 //#define FF_BUG_FAKE_SCALABILITY 16 //autodetection should work 100%
         
     /**
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index b8ea14c34c165c5cb141c6db0baaf1f1d43aa94f..653a2a8708bb480e0a9ab46b1e50b7c745819e5e 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -372,6 +372,10 @@ uint64_t time= rdtsc();
             s->workaround_bugs|= FF_BUG_UMP4;
             s->workaround_bugs|= FF_BUG_AC_VLC;
         }
+
+        if(s->divx_version){
+            s->workaround_bugs|= FF_BUG_QPEL_CHROMA;
+        }
 //printf("padding_bug_score: %d\n", s->padding_bug_score);
 #if 0
         if(s->divx_version==500)
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index dff8fffe75eaba1cf69690eb18578d8bcc99b475..7fadcc2a0f9a561e32e3f472ec64b118823854da 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1384,7 +1384,7 @@ static inline void qpel_motion(MpegEncContext *s,
     if(field_based){
         mx= motion_x/2;
         my= motion_y>>1;
-    }else if(s->divx_version){
+    }else if(s->workaround_bugs&FF_BUG_QPEL_CHROMA){
         mx= (motion_x>>1)|(motion_x&1);
         my= (motion_y>>1)|(motion_y&1);
     }else{