X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fpnmdec.c;h=e6c91ef99601c4d55f3f23a7a80d3f6990b1ed7e;hb=f57ab7ed376eea3ebb808583cdef7af4b0e1144e;hp=4060c4e3b5988fe5202cb6e2aaffa31540a18ee3;hpb=00430075bd0f06e4c6d9612f3a522255155b035b;p=ffmpeg diff --git a/libavcodec/pnmdec.c b/libavcodec/pnmdec.c index 4060c4e3b59..e6c91ef9960 100644 --- a/libavcodec/pnmdec.c +++ b/libavcodec/pnmdec.c @@ -20,7 +20,6 @@ */ #include "avcodec.h" -#include "bytestream.h" #include "put_bits.h" #include "pnm.h" @@ -68,6 +67,11 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data, components=3; sample_len=16; goto do_read; + case PIX_FMT_RGBA: + n = avctx->width * 4; + components=4; + sample_len=8; + goto do_read; case PIX_FMT_RGB24: n = avctx->width * 3; components=3; @@ -178,24 +182,6 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data, } } break; - case PIX_FMT_RGB32: - ptr = p->data[0]; - linesize = p->linesize[0]; - if (s->bytestream + avctx->width * avctx->height * 4 > s->bytestream_end) - return -1; - for (i = 0; i < avctx->height; i++) { - int j, r, g, b, a; - - for (j = 0; j < avctx->width; j++) { - r = *s->bytestream++; - g = *s->bytestream++; - b = *s->bytestream++; - a = *s->bytestream++; - ((uint32_t *)ptr)[j] = (a << 24) | (r << 16) | (g << 8) | b; - } - ptr += linesize; - } - break; } *picture = *(AVFrame*)&s->picture; *data_size = sizeof(AVPicture);