]> git.sesse.net Git - ffmpeg/commitdiff
lavc/dpx: Reset n_datum for every new line when decoding 12bit.
authorCarl Eugen Hoyos <ceffmpeg@gmail.com>
Wed, 13 Jun 2018 12:19:45 +0000 (14:19 +0200)
committerCarl Eugen Hoyos <ceffmpeg@gmail.com>
Thu, 14 Jun 2018 23:21:48 +0000 (01:21 +0200)
Fixes odd unpacked 12bit decoding.
Reported-by: Piotr Bandurski
libavcodec/dpx.c
libavcodec/version.h

index fb388b6e52379c4357bf333876f67d92d419b2bb..e9f0e05ecda3dc5b1fde16b92cfc0a2382cc4f14 100644 (file)
@@ -234,10 +234,10 @@ static int decode_frame(AVCodecContext *avctx,
     case 12:
         if (!packing) {
             int tested = 0;
-            if (descriptor == 50 && endian && (avctx->width%8) == 0) { // Little endian and widths not a multiple of 8 need tests
+            if (descriptor == 50 && endian) { // Little endian needs tests
                 tested = 1;
             }
-            if (descriptor == 51 && endian && (avctx->width%2) == 0) { // Little endian and widths not a multiple of 2 need tests
+            if (descriptor == 51 && endian) { // Little endian needs tests
                 tested = 1;
             }
             if (!tested) {
@@ -422,6 +422,7 @@ static int decode_frame(AVCodecContext *avctx,
                                                &n_datum, endian);
                 }
             }
+            n_datum = 0;
             for (i = 0; i < elements; i++)
                 ptr[i] += p->linesize[i];
             // Jump to next aligned position
index 5e71b488165f5cf626623d3196d7ea30d23fc757..219f56c37d8cda64db5e767e4207972dc9c41ad8 100644 (file)
@@ -29,7 +29,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR  58
 #define LIBAVCODEC_VERSION_MINOR  20
-#define LIBAVCODEC_VERSION_MICRO 101
+#define LIBAVCODEC_VERSION_MICRO 102
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                                LIBAVCODEC_VERSION_MINOR, \