Signed-off-by: Paul B Mahol <[email protected]>
---
 libavcodec/png.c    |    3 ---
 libavcodec/png.h    |    6 +++---
 libavcodec/pngdec.c |    4 ++--
 libavcodec/pngenc.c |    2 +-
 4 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/libavcodec/png.c b/libavcodec/png.c
index 70a080e..00f2a97 100644
--- a/libavcodec/png.c
+++ b/libavcodec/png.c
@@ -22,9 +22,6 @@
 #include "bytestream.h"
 #include "png.h"
 
-const uint8_t ff_pngsig[8] = {137, 80, 78, 71, 13, 10, 26, 10};
-const uint8_t ff_mngsig[8] = {138, 77, 78, 71, 13, 10, 26, 10};
-
 /* Mask to determine which y pixels are valid in a pass */
 const uint8_t ff_png_pass_ymask[NB_PASSES] = {
     0x80, 0x80, 0x08, 0x88, 0x22, 0xaa, 0x55,
diff --git a/libavcodec/png.h b/libavcodec/png.h
index b8c72ee..01faaac 100644
--- a/libavcodec/png.h
+++ b/libavcodec/png.h
@@ -24,6 +24,9 @@
 
 #include <stdint.h>
 
+#define PNG_SIGNATURE "\x89PNG\r\n\x1a\n"
+#define MNG_SIGNATURE "\x8aMNG\r\n\x1a\n"
+
 #define PNG_COLOR_MASK_PALETTE    1
 #define PNG_COLOR_MASK_COLOR      2
 #define PNG_COLOR_MASK_ALPHA      4
@@ -49,9 +52,6 @@
 
 #define NB_PASSES 7
 
-extern const uint8_t ff_pngsig[8];
-extern const uint8_t ff_mngsig[8];
-
 /* Mask to determine which y pixels are valid in a pass */
 extern const uint8_t ff_png_pass_ymask[NB_PASSES];
 
diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 66afb0e..9237cfd 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -408,8 +408,8 @@ static int decode_frame(AVCodecContext *avctx,
     s->bytestream_end= buf + buf_size;
 
     /* check signature */
-    if (memcmp(s->bytestream, ff_pngsig, 8) != 0 &&
-        memcmp(s->bytestream, ff_mngsig, 8) != 0)
+    if (memcmp(s->bytestream, PNG_SIGNATURE, 8) != 0 &&
+        memcmp(s->bytestream, MNG_SIGNATURE, 8) != 0)
         return -1;
     s->bytestream+= 8;
     s->y=
diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index bf7dd1a..3295c90 100644
--- a/libavcodec/pngenc.c
+++ b/libavcodec/pngenc.c
@@ -318,7 +318,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket 
*pkt,
     }
 
     /* write png header */
-    memcpy(s->bytestream, ff_pngsig, 8);
+    memcpy(s->bytestream, PNG_SIGNATURE, 8);
     s->bytestream += 8;
 
     AV_WB32(s->buf, avctx->width);
-- 
1.7.7

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to