avcodec/fitsdec: write output to frame directly
authorParas Chadha <paraschadha18@gmail.com>
Sat, 2 Sep 2017 19:07:21 +0000 (00:37 +0530)
committerJames Almer <jamrial@gmail.com>
Thu, 7 Sep 2017 01:48:42 +0000 (22:48 -0300)
Signed-off-by: Paras Chadha <paraschadha18@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/fitsdec.c

index 8ede0bc..b075381 100644 (file)
@@ -264,11 +264,10 @@ static int fits_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
             for (j = 0; j < avctx->width; j++) { \
                 t = rd; \
                 if (!header.blank_found || t != header.blank) { \
-                    t = ((t - header.data_min) * ((1 << (sizeof(type) * 8)) - 1)) / (header.data_max - header.data_min); \
+                    *dst++ = ((t - header.data_min) * ((1 << (sizeof(type) * 8)) - 1)) / (header.data_max - header.data_min); \
                 } else { \
-                    t = fitsctx->blank_val; \
+                    *dst++ = fitsctx->blank_val; \
                 } \
-                *dst++ = (type) t; \
                 ptr8 += abs(cas) >> 3; \
             } \
         } \