[FFmpeg-soc] [soc]: r511 - dirac/libavcodec/dirac.c

marco subversion at mplayerhq.hu
Mon Jul 23 22:48:59 CEST 2007


Author: marco
Date: Mon Jul 23 22:48:59 2007
New Revision: 511

Log:
Force the pixel to a valid range before writing it to the frame.


Modified:
   dirac/libavcodec/dirac.c

Modified: dirac/libavcodec/dirac.c
==============================================================================
--- dirac/libavcodec/dirac.c	(original)
+++ dirac/libavcodec/dirac.c	Mon Jul 23 22:48:59 2007
@@ -1118,7 +1118,7 @@ static int decode_intra_frame(AVCodecCon
         /* XXX: Show the coefficients in a frame.  */
         for (x = 0; x < width; x++)
             for (y = 0; y < height; y++)
-                frame[x + y * s->picture.linesize[comp]] = coeffs[x + y * s->padded_width];
+                frame[x + y * s->picture.linesize[comp]] = FFMAX(0, FFMIN(255, coeffs[x + y * s->padded_width]));
         av_free(coeffs);
     }
 



More information about the FFmpeg-soc mailing list