Skip to content

Commit

Permalink
removed dimension call
Browse files Browse the repository at this point in the history
  • Loading branch information
adl1995 committed Mar 6, 2017
1 parent 97465bd commit 9443794
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions libavcodec/xpmdec.c
Expand Up @@ -85,21 +85,16 @@ static int xpm_decode_frame(AVCodecContext *avctx, void *data,
AVFrame *p = data;
/*AVFrame *p = avctx->coded_frame;*/
XPMDecContext *x = avctx->priv_data;
int width = 0;
int height = 0;
const uint8_t *end, *ptr = avpkt->data;
int ncolors, cpp, ret, i, j;
uint8_t *dst, rgba[4];



end = avpkt->data + avpkt->size;
if (memcmp(ptr, "/* XPM */", 9)) {
av_log(avctx, AV_LOG_ERROR, "missing signature\n");
return AVERROR_INVALIDDATA;
}


/*
string parsed_data;
for (int i = 0; i < sizeof(ptr)/sizeof(uint8_t); ++i)
Expand All @@ -115,12 +110,6 @@ static int xpm_decode_frame(AVCodecContext *avctx, void *data,
return AVERROR_INVALIDDATA;
}

width = parse_str_int(avpkt->data, avpkt->size, "_width");
height = parse_str_int(avpkt->data, avpkt->size, "_height");

if ((ret = ff_set_dimensions(avctx, width, height)) < 0)
return ret;

if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
return ret;

Expand All @@ -147,6 +136,7 @@ static int xpm_decode_frame(AVCodecContext *avctx, void *data,
if ((ret = avctx->get_buffer(avctx, p)) < 0)
return ret;
*/

av_fast_padded_malloc(&x->pixels, &x->pixels_size, cpp == 2 ? 94 * 94 : 94);
if (!x->pixels)
return AVERROR(ENOMEM);
Expand Down Expand Up @@ -202,7 +192,6 @@ static int xpm_decode_frame(AVCodecContext *avctx, void *data,
}



p->key_frame = 1;
p->pict_type = AV_PICTURE_TYPE_I;

Expand Down

0 comments on commit 9443794

Please sign in to comment.