[FFmpeg-cvslog] r30358 - trunk/libswscale/swscale.c
stefano
subversion
Mon Jan 18 00:00:01 CET 2010
Author: stefano
Date: Mon Jan 18 00:00:01 2010
New Revision: 30358
Log:
Make the pal2rgbWrapper set and use the converter in pal2rgbWrapper
only if the input format is paletted.
Fix potential crashes/weirdness if the input format is non-paletted.
Modified:
trunk/libswscale/swscale.c
Modified: trunk/libswscale/swscale.c
==============================================================================
--- trunk/libswscale/swscale.c Sun Jan 17 20:26:35 2010 (r30357)
+++ trunk/libswscale/swscale.c Mon Jan 18 00:00:01 2010 (r30358)
@@ -2035,7 +2035,7 @@ static int pal2rgbWrapper(SwsContext *c,
if (!usePal(srcFormat))
av_log(c, AV_LOG_ERROR, "internal error %s -> %s converter\n",
sws_format_name(srcFormat), sws_format_name(dstFormat));
-
+ else {
switch(dstFormat) {
case PIX_FMT_RGB32 : conv = palette8topacked32; break;
case PIX_FMT_BGR32 : conv = palette8topacked32; break;
@@ -2046,8 +2046,9 @@ static int pal2rgbWrapper(SwsContext *c,
default: av_log(c, AV_LOG_ERROR, "internal error %s -> %s converter\n",
sws_format_name(srcFormat), sws_format_name(dstFormat)); break;
}
+ }
-
+ if (conv)
for (i=0; i<srcSliceH; i++) {
conv(srcPtr, dstPtr, c->srcW, (uint8_t *) c->pal_rgb);
srcPtr+= srcStride[0];
More information about the ffmpeg-cvslog
mailing list