]> git.sesse.net Git - ffmpeg/commitdiff
Merge commit 'd8f3b0fb584677d4882e3a2d7c28f8b15c7319f5'
authorHendrik Leppkes <h.leppkes@gmail.com>
Mon, 14 Nov 2016 11:16:32 +0000 (12:16 +0100)
committerHendrik Leppkes <h.leppkes@gmail.com>
Mon, 14 Nov 2016 11:16:32 +0000 (12:16 +0100)
* commit 'd8f3b0fb584677d4882e3a2d7c28f8b15c7319f5':
  targaenc: Move size check to initialization function

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
1  2 
libavcodec/targaenc.c

index 66bc55c3974c129547d28f697ce4f93e713154e9,f0cee38542fd9f2b705eaab94ca686bf453051c8..79030a012b2bf7461bfc74a5dfbd53f2e4bc54fc
@@@ -86,17 -86,15 +86,13 @@@ static int targa_encode_frame(AVCodecCo
                                const AVFrame *p, int *got_packet)
  {
      TargaContext *s = avctx->priv_data;
 -    int bpp, picsize, datasize = -1, ret;
 +    int bpp, picsize, datasize = -1, ret, i;
      uint8_t *out;
  
-     if(avctx->width > 0xffff || avctx->height > 0xffff) {
-         av_log(avctx, AV_LOG_ERROR, "image dimensions too large\n");
-         return AVERROR(EINVAL);
-     }
      picsize = av_image_get_buffer_size(avctx->pix_fmt,
                                         avctx->width, avctx->height, 1);
 -    if ((ret = ff_alloc_packet(pkt, picsize + 45)) < 0) {
 -        av_log(avctx, AV_LOG_ERROR, "encoded frame too large\n");
 +    if ((ret = ff_alloc_packet2(avctx, pkt, picsize + 45, 0)) < 0)
          return ret;
 -    }
  
      /* zero out the header and only set applicable fields */
      memset(pkt->data, 0, 12);