On 11/12/11 18:34, Kostya Shishkov wrote:
On Sun, Dec 11, 2011 at 10:15:14PM +0530, Shitiz Garg wrote:
---
  libavcodec/motionpixels.c |    5 +++++
  1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c
index d054e00..b35a776 100644
--- a/libavcodec/motionpixels.c
+++ b/libavcodec/motionpixels.c
@@ -71,6 +71,11 @@ static void mp_read_changes_map(MotionPixelsContext *mp, 
GetBitContext *gb, int
      uint16_t *pixels;
      int offset, w, h, color = 0, x, y, i;

+    if (count * (mp->offset_bits_len + bits_len * 2 + !!read_color * 15)>  
get_bits_left(gb)) {

if the expression is used otherwise, why not put it in a nice variable and keep the line shorter?

+        av_log(mp->avctx, AV_LOG_ERROR, "Not enough bits left to read\n");
+        return;
+    }
+
      while (count--) {
          offset = get_bits_long(gb, mp->offset_bits_len);
          w      = get_bits(gb, bits_len) + 1;
--

looks good enough to me
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel


--

Luca Barbato
Gentoo/linux
http://dev.gentoo.org/~lu_zero

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to