]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/targa.c
indeo5: check motion vectors.
[ffmpeg] / libavcodec / targa.c
index 56e02c1b21b9cffde5a1ca5b358bb9b182ca4216..5ddd21bfef58f5ecb7037640b2436208d4afded5 100644 (file)
@@ -55,7 +55,7 @@ static int targa_decode_rle(AVCodecContext *avctx, TargaContext *s, const uint8_
         type = *src++;
         count = (type & 0x7F) + 1;
         type &= 0x80;
-        if((x + count > w) && (x + count + 1 > (h - y) * w)){
+        if(x + count > (h - y) * w){
             av_log(avctx, AV_LOG_ERROR, "Packet went out of bounds: position (%i,%i) size %i\n", x, y, count);
             return -1;
         }
@@ -106,7 +106,7 @@ static int decode_frame(AVCodecContext *avctx,
     const uint8_t *buf_end = avpkt->data + avpkt->size;
     TargaContext * const s = avctx->priv_data;
     AVFrame *picture = data;
-    AVFrame * const p= (AVFrame*)&s->picture;
+    AVFrame * const p = &s->picture;
     uint8_t *dst;
     int stride;
     int idlen, pal, compr, y, w, h, bpp, flags;
@@ -262,7 +262,7 @@ static int decode_frame(AVCodecContext *avctx,
         }
     }
 
-    *picture= *(AVFrame*)&s->picture;
+    *picture   = s->picture;
     *data_size = sizeof(AVPicture);
 
     return avpkt->size;
@@ -271,8 +271,8 @@ static int decode_frame(AVCodecContext *avctx,
 static av_cold int targa_init(AVCodecContext *avctx){
     TargaContext *s = avctx->priv_data;
 
-    avcodec_get_frame_defaults((AVFrame*)&s->picture);
-    avctx->coded_frame= (AVFrame*)&s->picture;
+    avcodec_get_frame_defaults(&s->picture);
+    avctx->coded_frame = &s->picture;
 
     return 0;
 }