summaryrefslogtreecommitdiff
path: root/libavcodec/pnmenc.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2015-10-14 11:33:24 +0200
committerVittorio Giovara <vittorio.giovara@gmail.com>2015-10-21 11:59:59 +0200
commitf890677d05bc4e8b494a73373ab4cc19791bf884 (patch)
treecb66705498706dc94caa00ae80962f770a7ba056 /libavcodec/pnmenc.c
parent13bddab7de10aebf6efb98aa6d7ff0c51bb0e364 (diff)
downloadffmpeg-f890677d05bc4e8b494a73373ab4cc19791bf884.tar.gz
Replace any remaining avpicture function with imgutils
avpicture_get_size() -> av_image_get_buffer_size() Signed-off-by: Vittorio Giovara <vittorio.giovara@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 791176a11c..f8c600f937 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 "bytestream.h"
@@ -31,10 +32,10 @@ static int pnm_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame * const p = pict;
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_packet(pkt, avpicture_get_size(avctx->pix_fmt,
- avctx->width,
- avctx->height) + 200)) < 0) {
+ if ((ret = ff_alloc_packet(pkt, size + 200)) < 0) {
av_log(avctx, AV_LOG_ERROR, "encoded frame too large\n");
return ret;
}