avoid infinite loop if pixel format conversion does not exist
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>
Tue, 18 Dec 2007 13:49:58 +0000 (13:49 +0000)
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>
Tue, 18 Dec 2007 13:49:58 +0000 (13:49 +0000)
Originally committed as revision 11259 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/imgconvert.c

index 0299dbb..229a3a3 100644 (file)
@@ -2555,6 +2555,8 @@ int img_convert(AVPicture *dst, int dst_pix_fmt,
         else
             int_pix_fmt = PIX_FMT_RGB24;
     }
         else
             int_pix_fmt = PIX_FMT_RGB24;
     }
+    if (src_pix_fmt == int_pix_fmt)
+        return -1;
     if (avpicture_alloc(tmp, int_pix_fmt, dst_width, dst_height) < 0)
         return -1;
     ret = -1;
     if (avpicture_alloc(tmp, int_pix_fmt, dst_width, dst_height) < 0)
         return -1;
     ret = -1;