From ad532d37b2958f6c7652429be36ddd46a65ab67a Mon Sep 17 00:00:00 2001
From: Philipp Zabel
Date: Tue, 24 Mar 2015 14:30:52 -0300
Subject: [PATCH] [media] coda: allocate bitstream buffer from REQBUFS, size
depends on the format
Allocating the bitstream buffer only when the format is set allows to guarantee
that at least two frames fit into the bitstream buffer. For small frame sizes
a smaller bitstream buffer can be allocated. Since the bitstream buffer size now
depends on the format, replace CODA_MAX_FRAME_SIZE with ctx->bitstream.size
where appropriate and remove the now unused constant.
Since REQBUFS can be called multiple times, but the format can't be changed
unless REQBUFS 0 was called before, we can just keep the allocated context and
bitstream buffers if REQBUFS is called multiple times with a non-zero buffer
count.
[fixed a resource leak preventing repeatedly decoding]
Signed-off-by: Peter Seiderer
Signed-off-by: Philipp Zabel
Signed-off-by: Kamil Debski
Signed-off-by: Mauro Carvalho Chehab
---
Reading git-format-patch failed