mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
pamenc: allocate the correct packetsize for mono.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
5d468edb2e
commit
d3f81a6700
@ -37,7 +37,7 @@ static int pam_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
|||||||
w = avctx->width;
|
w = avctx->width;
|
||||||
switch (avctx->pix_fmt) {
|
switch (avctx->pix_fmt) {
|
||||||
case PIX_FMT_MONOBLACK:
|
case PIX_FMT_MONOBLACK:
|
||||||
n = (w + 7) >> 3;
|
n = w;
|
||||||
depth = 1;
|
depth = 1;
|
||||||
maxval = 1;
|
maxval = 1;
|
||||||
tuple_type = "BLACKANDWHITE";
|
tuple_type = "BLACKANDWHITE";
|
||||||
@ -88,9 +88,7 @@ static int pam_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ret = ff_alloc_packet(pkt, avpicture_get_size(avctx->pix_fmt,
|
if ((ret = ff_alloc_packet(pkt, n*h + 200)) < 0) {
|
||||||
avctx->width,
|
|
||||||
avctx->height) + 200)) < 0) {
|
|
||||||
av_log(avctx, AV_LOG_ERROR, "encoded frame too large\n");
|
av_log(avctx, AV_LOG_ERROR, "encoded frame too large\n");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user