openh264 icon indicating copy to clipboard operation
openh264 copied to clipboard

[PATCH] Remove assignment of function parameter, which has no effect outside the function

Open orbitcowboy opened this issue 12 years ago • 3 comments

Please review the attached patch, it removes an assignment of a function parameter, which has no effect outside function.

Here is the patch:

diff --git a/codec/decoder/plus/src/welsDecoderExt.cpp b/codec/decoder/plus/src/welsDecoderExt.cpp
index 65dd30a..eec4609 100644
--- a/codec/decoder/plus/src/welsDecoderExt.cpp
+++ b/codec/decoder/plus/src/welsDecoderExt.cpp
@@ -480,6 +480,5 @@ long CreateDecoder (ISVCDecoder** ppDecoder) {
 void_t DestroyDecoder (ISVCDecoder* pDecoder) {
   if (NULL != pDecoder) {
     delete (CWelsDecoder*)pDecoder;
-    pDecoder = NULL;
   }
 }

Best regards and many thanks

Martin Ettl

orbitcowboy avatar Dec 16 '13 08:12 orbitcowboy

I think it is a good habit to set NULL when delete a point.

kali2 avatar Dec 16 '13 09:12 kali2

Since ISVCDecoder* pDecoder is provided by value, setting this pointer to NULL has no effect. Its simply a waste of time.

orbitcowboy avatar Dec 16 '13 09:12 orbitcowboy

Rolled into pull request #58

ethanhugg avatar Dec 16 '13 17:12 ethanhugg