summaryrefslogtreecommitdiff
path: root/libavcodec/pnmenc.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-10-22 20:42:28 +0200
committerHendrik Leppkes <h.leppkes@gmail.com>2015-10-22 20:48:54 +0200
commit470204218f37e361da02d75845f9db9793a4ee53 (patch)
treeba86e91f6b2c0a35192e4c04ab7182cadb5d3699 /libavcodec/pnmenc.c
parent4c46f1d493f4d68121526fbede459619a02afa5a (diff)
parentf890677d05bc4e8b494a73373ab4cc19791bf884 (diff)
Merge commit 'f890677d05bc4e8b494a73373ab4cc19791bf884'
* commit 'f890677d05bc4e8b494a73373ab4cc19791bf884': Replace any remaining avpicture function with imgutils Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavcodec/pnmenc.c')
-rw-r--r--libavcodec/pnmenc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/pnmenc.c b/libavcodec/pnmenc.c
index b3eb5d90d3..ba9478d0da 100644
--- a/libavcodec/pnmenc.c
+++ b/libavcodec/pnmenc.c
@@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/imgutils.h"
#include "libavutil/pixdesc.h"
#include "avcodec.h"
#include "internal.h"
@@ -29,10 +30,10 @@ static int pnm_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
uint8_t *bytestream, *bytestream_start, *bytestream_end;
int i, h, h1, c, n, linesize, ret;
uint8_t *ptr, *ptr1, *ptr2;
+ int size = av_image_get_buffer_size(avctx->pix_fmt,
+ avctx->width, avctx->height, 1);
- if ((ret = ff_alloc_packet2(avctx, pkt, avpicture_get_size(avctx->pix_fmt,
- avctx->width,
- avctx->height) + 200, 0)) < 0)
+ if ((ret = ff_alloc_packet2(avctx, pkt, size + 200, 0)) < 0)
return ret;
bytestream_start =