diff mbox

[FFmpeg-devel,1/2] avcodec/fitsdec: write output to frame directly

Message ID 1504379242-8281-1-git-send-email-paraschadha18@gmail.com
State Accepted
Commit b07faf39ed10f5b24726aa25cd7134aeebb29e68
Headers show

Commit Message

Paras Sept. 2, 2017, 7:07 p.m. UTC
Signed-off-by: Paras Chadha <paraschadha18@gmail.com>
---
This fixes the failed fate tests on mingw32:
http://fate.ffmpeg.org/report.cgi?time=20170902182311&slot=x86_32-mingw-w64-dll-windows-native

 libavcodec/fitsdec.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--
2.4.11

Comments

James Almer Sept. 7, 2017, 1:50 a.m. UTC | #1
On 9/2/2017 4:07 PM, Paras Chadha wrote:
> Signed-off-by: Paras Chadha <paraschadha18@gmail.com>
> ---
> This fixes the failed fate tests on mingw32:
> http://fate.ffmpeg.org/report.cgi?time=20170902182311&slot=x86_32-mingw-w64-dll-windows-native
> 
>  libavcodec/fitsdec.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/libavcodec/fitsdec.c b/libavcodec/fitsdec.c
> index 616a837..ec15248 100644
> --- a/libavcodec/fitsdec.c
> +++ b/libavcodec/fitsdec.c
> @@ -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; \
>              } \
>          } \
> --
> 2.4.11

Pushed, thanks!
diff mbox

Patch

diff --git a/libavcodec/fitsdec.c b/libavcodec/fitsdec.c
index 616a837..ec15248 100644
--- a/libavcodec/fitsdec.c
+++ b/libavcodec/fitsdec.c
@@ -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; \
             } \
         } \