[FFmpeg-devel] [PATCH] dpx: fix some stupid typos

Georg Lippitsch georg.lippitsch at gmx.at
Tue Aug 28 14:07:18 CEST 2012


---
 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++) {
                             memcpy(dst[i], buf, FFMIN(source_bpc, target_bpc));
                             dst[i] += target_bpc;
                             buf += source_bpc;
-- 
1.7.3.4



More information about the ffmpeg-devel mailing list