test if color conv fonction exists prior to using it
authorBenoit Fouet <benoit.fouet@free.fr>
Wed, 2 May 2007 07:00:10 +0000 (07:00 +0000)
committerBenoit Fouet <benoit.fouet@free.fr>
Wed, 2 May 2007 07:00:10 +0000 (07:00 +0000)
Originally committed as revision 23206 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale

libswscale/swscale.c

index 901e6c6..1d26d12 100644 (file)
@@ -1611,6 +1611,8 @@ static int rgb2rgbWrapper(SwsContext *c, uint8_t* src[], int srcStride[], int sr
                sws_format_name(srcFormat), sws_format_name(dstFormat));
     }
 
                sws_format_name(srcFormat), sws_format_name(dstFormat));
     }
 
+    if(conv)
+    {
     if (dstStride[0]*srcBpp == srcStride[0]*dstBpp)
         conv(src[0], dst[0] + dstStride[0]*srcSliceY, srcSliceH*srcStride[0]);
     else
     if (dstStride[0]*srcBpp == srcStride[0]*dstBpp)
         conv(src[0], dst[0] + dstStride[0]*srcSliceY, srcSliceH*srcStride[0]);
     else
@@ -1626,6 +1628,7 @@ static int rgb2rgbWrapper(SwsContext *c, uint8_t* src[], int srcStride[], int sr
             dstPtr+= dstStride[0];
         }
     }
             dstPtr+= dstStride[0];
         }
     }
+    }
     return srcSliceH;
 }
 
     return srcSliceH;
 }