[FFmpeg-devel] [PATCH] dpx: fix some stupid typos
Paul B Mahol
onemda at gmail.com
Tue Aug 28 16:05:25 CEST 2012
On 8/28/12, Georg Lippitsch <georg.lippitsch at gmx.at> wrote:
> ---
> libavcodec/dpx.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c
> index 71cf439..6df20e8 100644
> --- a/libavcodec/dpx.c
> +++ b/libavcodec/dpx.c
> @@ -141,9 +141,9 @@ static int decode_frame(AVCodecContext *avctx,
> break;
> case 12:
> if (endian) {
> - avctx->pix_fmt = elements == 4 ? PIX_FMT_GBRP12BE :
> PIX_FMT_GBRP12BE;
> + avctx->pix_fmt = PIX_FMT_GBRP12BE;
> } else {
> - avctx->pix_fmt = elements == 4 ? PIX_FMT_GBRP12LE :
> PIX_FMT_GBRP12LE;
> + avctx->pix_fmt = PIX_FMT_GBRP12LE;
> }
> target_packet_size = 6;
> source_packet_size = 6;
> @@ -206,14 +206,14 @@ static int decode_frame(AVCodecContext *avctx,
> case 12:
> case 16:
> if (planar) {
> - int source_bpc = target_packet_size / elements;
> + int source_bpc = source_packet_size / elements;
> int target_bpc = target_packet_size / elements;
> for (x = 0; x < avctx->height; x++) {
> uint8_t *dst[AV_NUM_DATA_POINTERS];
> for (i=0; i<elements; i++)
> dst[i] = ptr[i];
> for (y = 0; y < avctx->width; y++) {
> - for (i=0; i<3; i++) {
> + for (i=0; i<elements; i++) {
Shouldn't this crash if there is alpha channel and gbrp is used? gbrp
only have 3 components.
More information about the ffmpeg-devel
mailing list