avcodec/pnmdec: fix unaligned read
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 2 Sep 2013 10:32:32 +0000 (12:32 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 2 Sep 2013 10:32:32 +0000 (12:32 +0200)
Fixes fate-lavf-pam on alpha

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/pnmdec.c

index f88fc26..1e00723 100644 (file)
@@ -31,7 +31,7 @@ static void samplecpy(uint8_t *dst, const uint8_t *src, int n, int maxval)
     } else {
         int i;
         for (i=0; i<n/2; i++) {
-            ((uint16_t *)dst)[i] = av_be2ne16(((uint16_t *)src)[i]);
+            ((uint16_t *)dst)[i] = AV_RB16(src+2*i);
         }
     }
 }