]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/roqvideo.c
alacenc: do not set bits_per_coded_sample
[ffmpeg] / libavcodec / roqvideo.c
index edccc5f066c261d8eafa3dd545c2554d0b359549..77df0798db5a886870c65626b25a80f1fbc33838 100644 (file)
@@ -2,26 +2,26 @@
  * Copyright (C) 2003 Mike Melanson
  * Copyright (C) 2003 Dr. Tim Ferguson
  *
- * This file is part of FFmpeg.
+ * This file is part of Libav.
  *
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /**
- * @file roqvideo.c
- * Id RoQ Video common functions based on work by Dr. Tim Ferguson
+ * @file
+ * id RoQ Video common functions based on work by Dr. Tim Ferguson
  */
 
 #include "avcodec.h"
@@ -44,7 +44,7 @@ void ff_apply_vector_2x2(RoqContext *ri, int x, int y, roq_cell *cell)
     int boffs,stride;
 
     stride = ri->current_frame->linesize[0];
-    boffs = (y * stride) + x;
+    boffs = y*stride + x;
 
     bptr = ri->current_frame->data[0] + boffs;
     bptr[0       ] = cell->y[0];
@@ -74,7 +74,7 @@ void ff_apply_vector_4x4(RoqContext *ri, int x, int y, roq_cell *cell)
     int boffs,stride;
 
     stride = ri->current_frame->linesize[0];
-    boffs = (y * stride) + x;
+    boffs = y*stride + x;
 
     bptr = ri->current_frame->data[0] + boffs;
     bptr[         0] = bptr[         1] = bptr[stride    ] = bptr[stride  +1] = cell->y[0];
@@ -115,11 +115,16 @@ static inline void apply_motion_generic(RoqContext *ri, int x, int y, int deltax
         return;
     }
 
+    if (ri->last_frame->data[0] == NULL) {
+        av_log(ri->avctx, AV_LOG_ERROR, "Invalid decode type. Invalid header?\n");
+        return;
+    }
+
     for(cp = 0; cp < 3; cp++) {
         int outstride = ri->current_frame->linesize[cp];
         int instride  = ri->last_frame   ->linesize[cp];
-        block_copy(ri->current_frame->data[cp] + (y*outstride) + x,
-                   ri->last_frame->data[cp] + (my*instride) + mx,
+        block_copy(ri->current_frame->data[cp] + y*outstride + x,
+                   ri->last_frame->data[cp] + my*instride + mx,
                    outstride, instride, sz);
     }
 }