ASV-1/2 does not really have a header and so using FF_INPUT_BUFFER_MIN_SIZE is wasteful as well as ugly (such bounds should be codec-specific).
Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -271,8 +271,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 270 unmodified lines | ||
| 271 | 271 | return ret; |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | − if ((ret = ff_alloc_packet(avctx, pkt, c->mb_height * c->mb_width * MAX_MB_SIZE + | |
| 275 | − FF_INPUT_BUFFER_MIN_SIZE)) < 0) | |
| 274 | + ret = ff_alloc_packet(avctx, pkt, c->mb_height * c->mb_width * MAX_MB_SIZE + 3); | |
| 275 | + if (ret < 0) | |
| 276 | 276 | return ret; |
| 277 | 277 | |
| 278 | 278 | init_put_bits(&a->pb, pkt->data, pkt->size); |