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);