[01/12] rtpdec: Remove unnecessary checks

Message ID 1424795718-79013-1-git-send-email-martin@martin.st
State Committed
Commit 12251f997bbc0abb93be39c51021e6d404ca385f
Headers show

Commit Message

Martin Storsjö Feb. 24, 2015, 4:35 p.m.
The free function of a depacketizer won't be called if data is NULL.
---
 libavformat/rtpdec_h263_rfc2190.c | 2 --
 libavformat/rtpdec_latm.c         | 2 --
 2 files changed, 4 deletions(-)

Comments

Luca Barbato Feb. 24, 2015, 5:17 p.m. | #1
On 24/02/15 17:35, Martin Storsjö wrote:
> The free function of a depacketizer won't be called if data is NULL.
> ---
>  libavformat/rtpdec_h263_rfc2190.c | 2 --
>  libavformat/rtpdec_latm.c         | 2 --
>  2 files changed, 4 deletions(-)
> 

Ok.

Patch

diff --git a/libavformat/rtpdec_h263_rfc2190.c b/libavformat/rtpdec_h263_rfc2190.c
index a7e8287..ae6e38e 100644
--- a/libavformat/rtpdec_h263_rfc2190.c
+++ b/libavformat/rtpdec_h263_rfc2190.c
@@ -41,8 +41,6 @@  struct PayloadContext {
 
 static void h263_free_context(PayloadContext *data)
 {
-    if (!data)
-        return;
     if (data->buf) {
         uint8_t *p;
         avio_close_dyn_buf(data->buf, &p);
diff --git a/libavformat/rtpdec_latm.c b/libavformat/rtpdec_latm.c
index 9758efa..2da0fbf 100644
--- a/libavformat/rtpdec_latm.c
+++ b/libavformat/rtpdec_latm.c
@@ -33,8 +33,6 @@  struct PayloadContext {
 
 static void latm_free_context(PayloadContext *data)
 {
-    if (!data)
-        return;
     if (data->dyn_buf) {
         uint8_t *p;
         avio_close_dyn_buf(data->dyn_buf, &p);