summaryrefslogtreecommitdiff
path: root/libavcodec/mjpegdec.c
diff options
context:
space:
mode:
authorZhong Li <zhong.li@intel.com>2019-06-27 16:58:23 +0800
committerZhong Li <zhong.li@intel.com>2019-07-01 13:24:01 +0800
commita6c648f2b4fdace0eeea66a7b556bc814023b598 (patch)
tree62ca2068409de39a7a28a1dab20ecaf816cbc47f /libavcodec/mjpegdec.c
parent4dc3d93880315f66ce917ae327c67a85262f285e (diff)
lavc/mjpegdec: replace number with marker name
Make it easier to read. Signed-off-by: Zhong Li <zhong.li@intel.com>
Diffstat (limited to 'libavcodec/mjpegdec.c')
-rw-r--r--libavcodec/mjpegdec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 20eeb960bb..1030861e85 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -2115,7 +2115,7 @@ static int find_marker(const uint8_t **pbuf_ptr, const uint8_t *buf_end)
while (buf_end - buf_ptr > 1) {
v = *buf_ptr++;
v2 = *buf_ptr;
- if ((v == 0xff) && (v2 >= 0xc0) && (v2 <= 0xfe) && buf_ptr < buf_end) {
+ if ((v == 0xff) && (v2 >= SOF0) && (v2 <= COM) && buf_ptr < buf_end) {
val = *buf_ptr++;
goto found;
}
@@ -2180,7 +2180,7 @@ int ff_mjpeg_find_marker(MJpegDecodeContext *s,
src--;
}
- if (x < 0xd0 || x > 0xd7) {
+ if (x < RST0 || x > RST7) {
copy_data_segment(1);
if (x)
break;
@@ -2319,7 +2319,7 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
av_log(avctx, AV_LOG_DEBUG, "startcode: %X\n", start_code);
/* process markers */
- if (start_code >= 0xd0 && start_code <= 0xd7) {
+ if (start_code >= RST0 && start_code <= RST7) {
av_log(avctx, AV_LOG_DEBUG,
"restart marker: %d\n", start_code & 0x0f);
/* APP fields */