diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-01-17 23:00:01 +0000 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-01-17 23:00:01 +0000 |
commit | c0d1dc1c4f41ab76414e797a461efce128bda0ed (patch) | |
tree | a6440f56f44a6d0ef7ecdfcf36ff976ce600db29 /libswscale/swscale.c | |
parent | 2911e1322470630e1ab7e0e3923709e2a1b88947 (diff) | |
download | ffmpeg-c0d1dc1c4f41ab76414e797a461efce128bda0ed.tar.gz |
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.
Originally committed as revision 30358 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
Diffstat (limited to 'libswscale/swscale.c')
-rw-r--r-- | libswscale/swscale.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 6896d504ee..0623d5dc99 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -2035,7 +2035,7 @@ static int pal2rgbWrapper(SwsContext *c, const uint8_t* src[], int srcStride[], 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, const uint8_t* src[], int srcStride[], 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]; |