diff mbox

[FFmpeg-devel] avcodec/h264dec: remove unnecessary checks in h264_decode_frame

Message ID 20180906073828.30903-1-quinkblack@foxmail.com
State Accepted
Commit 037b3bd14a8d6ffe4cecd0875bfb021b6edfc2a4
Headers show

Commit Message

Zhao Zhili Sept. 6, 2018, 7:38 a.m. UTC
---
 libavcodec/h264dec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer Sept. 6, 2018, 8:43 a.m. UTC | #1
On Thu, Sep 06, 2018 at 03:38:28PM +0800, Zhao Zhili wrote:
> ---
>  libavcodec/h264dec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

why do you think the checks are unneeded ?

the commit message is not sufficient to understand the reasons for this change
does this fix a bug or ticket ? if so how can the bug be reproduced where is
the ticket?

thx

[...]
diff mbox

Patch

diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c
index b2447e9..bffce52 100644
--- a/libavcodec/h264dec.c
+++ b/libavcodec/h264dec.c
@@ -1000,7 +1000,7 @@  static int h264_decode_frame(AVCodecContext *avctx, void *data,
                                      &h->ps, &h->is_avc, &h->nal_length_size,
                                      avctx->err_recognition, avctx);
     }
-    if(h->is_avc && buf_size >= 9 && buf[0]==1 && buf[2]==0 && (buf[4]&0xFC)==0xFC && (buf[5]&0x1F) && buf[8]==0x67){
+    if (h->is_avc && buf_size >= 9 && buf[0]==1 && buf[2]==0 && (buf[4]&0xFC)==0xFC) {
         if (is_extra(buf, buf_size))
             return ff_h264_decode_extradata(buf, buf_size,
                                             &h->ps, &h->is_avc, &h->nal_length_size,